﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using internal_website.Meta;
using internal_website.Models.Resources;

namespace internal_website.Models
{
    public class Location : ILocation
    {
        #region Constructor

        public Location()
        {
            Events = new Collection<Event>();
        }

        #endregion

        [Key]
        public int Id { get; set; }
        public bool Active { get; set; }

        /**/
        #region Localized display and model validation attributes
        [Display(Name = "Location_Name_Display_Name", Prompt = "Location_Name_Display_Prompt", ResourceType = typeof(ValidationStrings))]
        [Required(ErrorMessageResourceName = "Location_Name_Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [LocalizedRegex("_LocationName_LocalizedRegex_Pattern", "Location_Name_LocalizedRegex_ErrorMessage", errorMessageResourceType: typeof(ValidationStrings))]
        #endregion
        public string Name { get; set; }

        /**/
        #region Localized display and model validation attributes
        [Display(Name = "Location_Description_Display_Name", Prompt = "Location_Description_Display_Prompt", ResourceType = typeof(ValidationStrings))]
        [Required(ErrorMessageResourceName = "Location_Description_Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [LocalizedRegex("_Description_LocalizedRegex_Pattern", "Location_Description_LocalizedRegex_ErrorMessage", errorMessageResourceType: typeof(ValidationStrings))]
        #endregion
        public string Description { get; set; }

        /**/
        #region Localized display and model validation attributes
        [Display(Name = "Location_Street_Display_Name", Prompt = "Location_Street_Display_Prompt", ResourceType = typeof(ValidationStrings))]
        [Required(ErrorMessageResourceName = "Location_Street_Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [LocalizedRegex("_Street_LocalizedRegex_Pattern", "Location_Street_LocalizedRegex_ErrorMessage", errorMessageResourceType: typeof(ValidationStrings))]
        #endregion
        public string Street { get; set; }

        /**/
        #region Localized display and model validation attributes
        [Display(Name = "Location_PostalCode_Display_Name", Prompt = "Location_PostalCode_Display_Prompt", ResourceType = typeof(ValidationStrings))]
        [Required(ErrorMessageResourceName = "Location_PostalCode_Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [LocalizedRegex("_PostalCode_LocalizedRegex_Pattern", "Location_PostalCode_LocalizedRegex_ErrorMessage", errorMessageResourceType: typeof(ValidationStrings))]
        #endregion
        public string PostalCode { get; set; }
        /**/
        #region Localized display and model validation attributes
        [Display(Name = "Location_City_Display_Name", Prompt = "Location_City_Display_Prompt", ResourceType = typeof(ValidationStrings))]
        [Required(ErrorMessageResourceName = "Location_City_Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [LocalizedRegex("_City_LocalizedRegex_Pattern", "Location_City_LocalizedRegex_ErrorMessage", errorMessageResourceType: typeof(ValidationStrings))]
        #endregion
        public string City { get; set; }
        /**/
        #region Localized display and model validation attributes
        [Display(Name = "Location_Country_Display_Name", Prompt = "Location_Country_Display_Prompt", ResourceType = typeof(ValidationStrings))]
        [Required(ErrorMessageResourceName = "Location_Country_Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [LocalizedRegex("_Country_LocalizedRegex_Pattern", "Location_Country_LocalizedRegex_ErrorMessage", errorMessageResourceType: typeof(ValidationStrings))]
        #endregion
        public string Country { get; set; }
        /**/
        #region Localized display and model validation attributes
        [Display(Name = "Location_Longitude_Display_Name", Prompt = "Location_Longitude_Display_Prompt", ResourceType = typeof(ValidationStrings))]
        [Required(ErrorMessageResourceName = "Location_Longitude_Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [LocalizedRegex("_Longitude_LocalizedRegex_Pattern", "Location_Longitude_LocalizedRegex_ErrorMessage", errorMessageResourceType: typeof(ValidationStrings))]
        #endregion
        public string Longitude { get; set; }
        /**/
        #region Localized display and model validation attributes
        [Display(Name = "Location_Latitude_Display_Name", Prompt = "Location_Latitude_Display_Prompt", ResourceType = typeof(ValidationStrings))]
        [Required(ErrorMessageResourceName = "Location_Latitude_Required", ErrorMessageResourceType = typeof(ValidationStrings))]
        [LocalizedRegex("_Latitude_LocalizedRegex_Pattern", "Location_Latitude_LocalizedRegex_ErrorMessage", errorMessageResourceType: typeof(ValidationStrings))]
        #endregion
        public string Latitude { get; set; }

        #region Navigation properties

        public virtual ICollection<Event> Events { get; set; }

        #endregion

    }
}